package com.momo.configuration;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Kagome on 2019/5/24.
 */
@Data
@ConfigurationProperties(prefix = "wx.mp")
@Service
public class WxProperties {
    private List<WxConfig> configs;

    @Data
    public static class WxConfig {
        /**
         * 设置微信公众号的appid
         */
        private String appId;

        /**
         * 设置微信公众号的app secret
         */
        private String secret;

        /**
         * 设置微信公众号的token
         */
        private String token;

        /**
         * 设置微信公众号的EncodingAESKey
         */
        private String aesKey;
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
